package cn.elwy.rcp.ui;

import org.eclipse.swt.graphics.Image;

import cn.elwy.osgi.config.util.ThemeUtil;
import cn.elwy.rcp.ui.util.ImageUtil;

/**
 * 系统图像资源管理类
 * @author huangsq
 * @version 1.0, 2014-01-13
 * @since 1.0, 2014-01-13
 */
public class AppImage {

  public static Image PAGE_BACK;
  public static Image PAGE_FIRST;
  public static Image PAGE_NEXT;
  public static Image PAGE_LAST;

  static {
    init();
  }

  public static void init() {
    Class<AppImage> clazz = AppImage.class;

    String filePath = ThemeUtil.getThemeFilePath("icons/direction/first.png");
    PAGE_FIRST = ImageUtil.getImage(clazz, filePath);

    filePath = ThemeUtil.getThemeFilePath("icons/direction/back.png");
    PAGE_BACK = ImageUtil.getImage(clazz, filePath);

    filePath = ThemeUtil.getThemeFilePath("icons/direction/next.png");
    PAGE_NEXT = ImageUtil.getImage(clazz, filePath);

    filePath = ThemeUtil.getThemeFilePath("icons/direction/last.png");
    PAGE_LAST = ImageUtil.getImage(clazz, filePath);

  }

  public static void dispose() {
    PAGE_BACK.dispose();
    PAGE_FIRST.dispose();
    PAGE_NEXT.dispose();
    PAGE_LAST.dispose();
  }

}
